package com.gmail.fanvaron.Commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

import com.gmail.fanvaron.Main.MarvMonsterPack;

public class CowScoreCommand implements CommandExecutor {

	MarvMonsterPack plugin;
	int score;

	public CowScoreCommand(MarvMonsterPack instance) {
		plugin = instance;
		score = 0;
	}

	@Override
	public boolean onCommand(CommandSender sender, Command command,
			String label, String[] args) {

		if (command.getName().equalsIgnoreCase("scow")) {

			if (args.length == 1 && args[0].equals("add")) {
				score++;
			} else if (args.length == 1 && args[0].equals("clear")) {
				score=0;
			} else if (args.length == 2 && args[0].equals("say")) {

				if ((plugin.getServer().getPlayer(args[1])) != null) {
					(plugin.getServer().getPlayer(args[1]))
							.sendMessage("You caught " + score + " cows.");

				}

			}
		}
		return true;

	}
}
